package com.asset.order.service.impl;

import com.asset.order.dao.OrderDao;
import com.asset.order.service.OrderService;
import jakarta.annotation.Resource;
import org.asset.entity.Order;
import org.asset.until.R;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.UUID;

@Service
public class OrderServiceImpl implements OrderService {

    @Resource
    private OrderDao orderDao;

    @Override
    public R addOrder(Order order) {
        String id = UUID.randomUUID().toString().replace("-", "");
        order.setId(id);
        order.setCreateTime(new Date());
        int i = orderDao.addOrder(order);
        return R.success("", order);
    }
}
